let toTop = document.getElementsByClassName("toTop");
toTop[0].onclick = function() {
    window.scrollTo({top:0});
}

window.onscroll = function() {

    let scrollHeight=document.body.scrollTop==0?document.documentElement.scrollTop:document.body.scrollTop;
    if(scrollHeight>700) {
        toTop[0].style.visibility = "visible"
    }
    else {
        toTop[0].style.visibility = "hidden";
    }
}